<template>
  <div class="business-detail">
    <!-- 页面头部 -->
    <div class="page-header">
      <div class="header-content">
        <div class="header-left">
          <el-button @click="goBack" class="back-btn">
            <i class="fas fa-arrow-left mr-2"></i>返回
          </el-button>
          <div class="title-section">
            <h1 class="page-title">
              <i :class="businessData.icon" class="mr-3"></i>
              {{ businessData.name }}
            </h1>
            <p class="page-description">{{ businessData.description }}</p>
          </div>
        </div>
        <div class="header-actions">
          <el-button type="primary" @click="editBusiness">
            <i class="fas fa-edit mr-2"></i>编辑业务
          </el-button>
          <el-button 
            :type="businessData.status === 'active' ? 'danger' : 'success'"
            @click="toggleStatus"
          >
            <i class="fas fa-power-off mr-2"></i>
            {{ businessData.status === 'active' ? '停用' : '启用' }}
          </el-button>
        </div>
      </div>
    </div>

    <!-- 业务概览 -->
    <div class="overview-section">
      <div class="overview-cards">
        <div class="overview-card">
          <div class="card-icon">
            <i class="fas fa-gavel text-blue-500"></i>
          </div>
          <div class="card-content">
            <div class="card-title">总案件数</div>
            <div class="card-value">{{ businessData.caseCount }}</div>
            <div class="card-subtitle">较上月 +{{ businessData.monthlyIncrease }}%</div>
          </div>
        </div>
        
        <div class="overview-card">
          <div class="card-icon">
            <i class="fas fa-dollar-sign text-green-500"></i>
          </div>
          <div class="card-content">
            <div class="card-title">总收入</div>
            <div class="card-value">¥{{ businessData.totalRevenue.toLocaleString() }}</div>
            <div class="card-subtitle">本月 ¥{{ businessData.monthlyRevenue.toLocaleString() }}</div>
          </div>
        </div>
        
        <div class="overview-card">
          <div class="card-icon">
            <i class="fas fa-clock text-orange-500"></i>
          </div>
          <div class="card-content">
            <div class="card-title">平均处理时间</div>
            <div class="card-value">{{ businessData.avgProcessTime }}天</div>
            <div class="card-subtitle">目标: {{ businessData.targetProcessTime }}天</div>
          </div>
        </div>
        
        <div class="overview-card">
          <div class="card-icon">
            <i class="fas fa-star text-yellow-500"></i>
          </div>
          <div class="card-content">
            <div class="card-title">客户满意度</div>
            <div class="card-value">{{ businessData.satisfaction }}%</div>
            <div class="card-subtitle">
              <el-rate 
                v-model="businessData.rating" 
                disabled 
                show-score 
                text-color="#ff9900"
                score-template="{value} 分"
              />
            </div>
          </div>
        </div>
      </div>
    </div>

    <!-- 详细信息 -->
    <div class="content-section">
      <el-row :gutter="24">
        <!-- 基本信息 -->
        <el-col :span="16">
          <div class="content-card">
            <div class="card-header">
              <h3 class="card-title">
                <i class="fas fa-info-circle mr-2"></i>基本信息
              </h3>
            </div>
            <div class="card-content">
              <div class="info-grid">
                <div class="info-item">
                  <label class="info-label">业务名称</label>
                  <div class="info-value">{{ businessData.name }}</div>
                </div>
                <div class="info-item">
                  <label class="info-label">业务类别</label>
                  <div class="info-value">
                    <el-tag>{{ businessData.category }}</el-tag>
                  </div>
                </div>
                <div class="info-item">
                  <label class="info-label">服务范围</label>
                  <div class="info-value">{{ businessData.scope }}</div>
                </div>
                <div class="info-item">
                  <label class="info-label">状态</label>
                  <div class="info-value">
                    <el-tag :type="businessData.status === 'active' ? 'success' : 'danger'">
                      {{ businessData.status === 'active' ? '启用' : '停用' }}
                    </el-tag>
                  </div>
                </div>
                <div class="info-item">
                  <label class="info-label">创建时间</label>
                  <div class="info-value">{{ businessData.createTime }}</div>
                </div>
                <div class="info-item">
                  <label class="info-label">最后更新</label>
                  <div class="info-value">{{ businessData.updateTime }}</div>
                </div>
              </div>
              
              <div class="description-section">
                <label class="info-label">业务描述</label>
                <div class="info-value description-content">
                  {{ businessData.detailedDescription }}
                </div>
              </div>
            </div>
          </div>

          <!-- 收费标准 -->
          <div class="content-card">
            <div class="card-header">
              <h3 class="card-title">
                <i class="fas fa-money-bill-wave mr-2"></i>收费标准
              </h3>
              <el-button size="small" type="primary" @click="addPricing">
                <i class="fas fa-plus mr-1"></i>添加
              </el-button>
            </div>
            <div class="card-content">
              <el-table :data="businessData.pricingRules" class="pricing-table">
                <el-table-column prop="serviceLevel" label="服务级别" width="120" />
                <el-table-column prop="basePrice" label="基础费用" width="120" align="center">
                  <template #default="{ row }">
                    <span class="text-green-600 font-semibold">¥{{ row.basePrice.toLocaleString() }}</span>
                  </template>
                </el-table-column>
                <el-table-column prop="additionalFee" label="附加费用" width="120" align="center">
                  <template #default="{ row }">
                    <span class="text-orange-600">¥{{ row.additionalFee.toLocaleString() }}</span>
                  </template>
                </el-table-column>
                <el-table-column prop="description" label="费用说明" min-width="200" />
                <el-table-column prop="effectiveDate" label="生效日期" width="120" />
                <el-table-column label="操作" width="150" align="center">
                  <template #default="{ row }">
                    <el-button size="small" @click="editPricing(row)">编辑</el-button>
                    <el-button size="small" type="danger" @click="deletePricing(row)">删除</el-button>
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </div>

          <!-- 工作流程 -->
          <div class="content-card">
            <div class="card-header">
              <h3 class="card-title">
                <i class="fas fa-sitemap mr-2"></i>工作流程
              </h3>
              <el-button size="small" type="primary" @click="editWorkflow">
                <i class="fas fa-edit mr-1"></i>编辑流程
              </el-button>
            </div>
            <div class="card-content">
              <div class="workflow-steps">
                <div 
                  v-for="(step, index) in businessData.workflow" 
                  :key="index"
                  class="workflow-step"
                >
                  <div class="step-number">{{ index + 1 }}</div>
                  <div class="step-content">
                    <div class="step-title">{{ step.title }}</div>
                    <div class="step-description">{{ step.description }}</div>
                    <div class="step-duration">预计用时: {{ step.duration }}</div>
                    
                    <!-- 通知配置显示 -->
                    <div v-if="step.notificationRoles && step.notificationRoles.length > 0" class="step-notifications">
                      <div class="notification-header">
                        <i class="fas fa-bell mr-1"></i>通知配置
                      </div>
                      
                      <div class="notification-info">
                        <div class="notification-row">
                          <span class="notification-label">通知角色：</span>
                          <div class="notification-tags">
                            <el-tag 
                              v-for="role in step.notificationRoles" 
                              :key="role" 
                              size="small" 
                              class="role-tag"
                            >
                              {{ getRoleDisplayName(role) }}
                            </el-tag>
                          </div>
                        </div>
                        
                        <div class="notification-row">
                          <span class="notification-label">通知方式：</span>
                          <div class="notification-tags">
                            <el-tag 
                              v-for="method in step.notificationMethods" 
                              :key="method" 
                              size="small" 
                              type="info"
                              class="method-tag"
                            >
                              {{ getMethodDisplayName(method) }}
                            </el-tag>
                          </div>
                        </div>
                        
                        <div class="notification-row">
                          <span class="notification-label">通知时机：</span>
                          <div class="notification-tags">
                            <el-tag 
                              v-for="timing in step.notificationTiming" 
                              :key="timing" 
                              size="small" 
                              type="warning"
                              class="timing-tag"
                            >
                              {{ getTimingDisplayName(timing) }}
                            </el-tag>
                          </div>
                        </div>
                        
                        <div v-if="step.notificationTemplate" class="notification-row">
                          <span class="notification-label">通知模板：</span>
                          <div class="notification-template">{{ step.notificationTemplate }}</div>
                        </div>
                        
                        <div class="notification-settings-summary">
                          <span v-if="step.autoNotification" class="setting-item">
                            <i class="fas fa-check-circle text-green-500"></i>自动发送
                          </span>
                          <span v-if="step.requireConfirmation" class="setting-item">
                            <i class="fas fa-shield-alt text-blue-500"></i>需要确认
                          </span>
                          <span v-if="step.escalateIfNoResponse" class="setting-item">
                            <i class="fas fa-exclamation-triangle text-orange-500"></i>升级通知
                          </span>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </el-col>

        <!-- 侧边栏 -->
        <el-col :span="8">
          <!-- 相关文档 -->
          <div class="content-card">
            <div class="card-header">
              <h3 class="card-title">
                <i class="fas fa-file-alt mr-2"></i>相关文档
              </h3>
              <el-button size="small" type="primary" @click="uploadDocument">
                <i class="fas fa-upload mr-1"></i>上传
              </el-button>
            </div>
            <div class="card-content">
              <div class="document-list">
                <div 
                  v-for="doc in businessData.documents" 
                  :key="doc.id"
                  class="document-item"
                >
                  <div class="document-icon">
                    <i :class="getDocumentIcon(doc.type)"></i>
                  </div>
                  <div class="document-info">
                    <div class="document-name">{{ doc.name }}</div>
                    <div class="document-meta">
                      {{ doc.size }} · {{ doc.uploadTime }}
                    </div>
                  </div>
                  <div class="document-actions">
                    <el-button size="small" text @click="downloadDocument(doc)">
                      <i class="fas fa-download"></i>
                    </el-button>
                    <el-button size="small" text type="danger" @click="deleteDocument(doc)">
                      <i class="fas fa-trash"></i>
                    </el-button>
                  </div>
                </div>
              </div>
            </div>
          </div>

          <!-- 负责律师 -->
          <div class="content-card">
            <div class="card-header">
              <h3 class="card-title">
                <i class="fas fa-user-tie mr-2"></i>负责律师
              </h3>
              <el-button size="small" type="primary" @click="assignLawyer">
                <i class="fas fa-user-plus mr-1"></i>分配
              </el-button>
            </div>
            <div class="card-content">
              <div class="lawyer-list">
                <div 
                  v-for="lawyer in businessData.assignedLawyers" 
                  :key="lawyer.id"
                  class="lawyer-item"
                >
                  <el-avatar :size="40" :src="lawyer.avatar" class="lawyer-avatar">
                    <i class="fas fa-user"></i>
                  </el-avatar>
                  <div class="lawyer-info">
                    <div class="lawyer-name">{{ lawyer.name }}</div>
                    <div class="lawyer-role">{{ lawyer.role }}</div>
                    <div class="lawyer-cases">负责案件: {{ lawyer.caseCount }}</div>
                  </div>
                </div>
              </div>
            </div>
          </div>

          <!-- 近期案件 -->
          <div class="content-card">
            <div class="card-header">
              <h3 class="card-title">
                <i class="fas fa-history mr-2"></i>近期案件
              </h3>
              <el-button size="small" text @click="viewAllCases">
                查看全部 <i class="fas fa-arrow-right ml-1"></i>
              </el-button>
            </div>
            <div class="card-content">
              <div class="case-list">
                <div 
                  v-for="case_item in businessData.recentCases" 
                  :key="case_item.id"
                  class="case-item"
                >
                  <div class="case-info">
                    <div class="case-title">{{ case_item.title }}</div>
                    <div class="case-meta">
                      <span class="case-client">{{ case_item.client }}</span>
                      <span class="case-date">{{ case_item.createTime }}</span>
                    </div>
                  </div>
                  <div class="case-status">
                    <el-tag :type="getCaseStatusType(case_item.status)" size="small">
                      {{ case_item.status }}
                    </el-tag>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script>
import { ref, reactive, onMounted } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { ElMessage, ElMessageBox } from 'element-plus'

export default {
  name: 'BusinessDetail',
  setup() {
    const route = useRoute()
    const router = useRouter()
    
    // 业务数据
    const businessData = reactive({
      id: route.params.id || 1,
      name: '交通事故人身损害赔偿',
      description: '专业处理交通事故导致的人身损害赔偿案件',
      detailedDescription: '交通事故人身损害赔偿是指机动车发生交通事故造成受害人人身伤亡、财产损失的，由保险公司在机动车第三者责任强制保险责任限额范围内予以赔偿；不足的部分，按照相关法律法规由当事人承担赔偿责任。我们的专业团队将为您提供从事故调查、伤残鉴定到法庭诉讼的全程法律服务。',
      icon: 'fas fa-car-crash text-red-500',
      category: '民事纠纷',
      scope: '全国范围',
      status: 'active',
      caseCount: 156,
      monthlyIncrease: 12,
      totalRevenue: 2856000,
      monthlyRevenue: 485000,
      avgProcessTime: 45,
      targetProcessTime: 60,
      satisfaction: 92,
      rating: 4.6,
      createTime: '2023-01-15 10:30:00',
      updateTime: '2024-01-20 16:45:00',
      pricingRules: [
        {
          id: 1,
          serviceLevel: '基础服务',
          basePrice: 5000,
          additionalFee: 1000,
          description: '包含基础法律咨询、文书代理',
          effectiveDate: '2024-01-01'
        },
        {
          id: 2,
          serviceLevel: '标准服务',
          basePrice: 10000,
          additionalFee: 2000,
          description: '包含诉讼代理、鉴定协助',
          effectiveDate: '2024-01-01'
        },
        {
          id: 3,
          serviceLevel: '高级服务',
          basePrice: 20000,
          additionalFee: 5000,
          description: '包含全程代理、专家咨询',
          effectiveDate: '2024-01-01'
        }
      ],
      workflow: [
        {
          title: '案件接收',
          description: '客户咨询，初步评估案件可行性',
          duration: '1-2天',
          notificationRoles: ['client', 'primary_lawyer'],
          notificationMethods: ['system_message', 'sms'],
          notificationTiming: ['step_start', 'step_complete'],
          reminderFrequency: 'once',
          notificationTemplate: '您的案件 {case_name} 已开始受理，负责律师：{lawyer_name}',
          autoNotification: true,
          requireConfirmation: false,
          escalateIfNoResponse: false
        },
        {
          title: '证据收集',
          description: '收集事故现场证据、医疗记录等',
          duration: '3-7天',
          notificationRoles: ['client', 'primary_lawyer', 'paralegal'],
          notificationMethods: ['system_message', 'email'],
          notificationTiming: ['step_start', 'step_progress', 'step_complete'],
          reminderFrequency: 'daily',
          notificationTemplate: '案件 {case_name} 正在进行证据收集，请配合提供相关材料',
          autoNotification: true,
          requireConfirmation: true,
          escalateIfNoResponse: true,
          escalationWaitTime: 48,
          escalationRecipients: ['department_manager']
        },
        {
          title: '伤残鉴定',
          description: '安排专业机构进行伤残等级鉴定',
          duration: '30-45天',
          notificationRoles: ['client', 'primary_lawyer', 'external_expert'],
          notificationMethods: ['system_message', 'sms', 'email'],
          notificationTiming: ['step_start', 'step_complete'],
          reminderFrequency: 'weekly',
          notificationTemplate: '案件 {case_name} 的伤残鉴定已安排，预计完成时间：{due_date}',
          autoNotification: true,
          requireConfirmation: false,
          escalateIfNoResponse: false
        },
        {
          title: '调解协商',
          description: '与对方及保险公司进行赔偿协商',
          duration: '7-15天',
          notificationRoles: ['client', 'primary_lawyer'],
          notificationMethods: ['system_message', 'wechat'],
          notificationTiming: ['step_start', 'step_progress', 'step_complete'],
          reminderFrequency: 'daily',
          notificationTemplate: '案件 {case_name} 正在进行调解协商，当前进展：{step_name}',
          autoNotification: true,
          requireConfirmation: true,
          escalateIfNoResponse: false
        },
        {
          title: '诉讼代理',
          description: '协商不成时提起诉讼并代理',
          duration: '60-120天',
          notificationRoles: ['client', 'primary_lawyer', 'assistant_lawyer'],
          notificationMethods: ['system_message', 'email', 'wechat'],
          notificationTiming: ['step_start', 'step_progress', 'step_complete'],
          reminderFrequency: 'weekly',
          notificationTemplate: '案件 {case_name} 已进入诉讼阶段，将由专业律师团队为您提供全程代理',
          autoNotification: true,
          requireConfirmation: true,
          escalateIfNoResponse: true,
          escalationWaitTime: 72,
          escalationRecipients: ['department_manager', 'partner']
        },
        {
          title: '执行阶段',
          description: '协助客户执行判决书或调解书',
          duration: '30-90天',
          notificationRoles: ['client', 'primary_lawyer', 'finance_staff'],
          notificationMethods: ['system_message', 'sms'],
          notificationTiming: ['step_start', 'step_complete'],
          reminderFrequency: 'weekly',
          notificationTemplate: '案件 {case_name} 进入执行阶段，我们将协助您完成赔偿的实际执行',
          autoNotification: true,
          requireConfirmation: false,
          escalateIfNoResponse: false
        }
      ],
      documents: [
        {
          id: 1,
          name: '交通事故处理流程指南.pdf',
          type: 'pdf',
          size: '2.5MB',
          uploadTime: '2024-01-15'
        },
        {
          id: 2,
          name: '人身损害赔偿标准表.xlsx',
          type: 'excel',
          size: '156KB',
          uploadTime: '2024-01-10'
        },
        {
          id: 3,
          name: '诉讼文书模板.docx',
          type: 'word',
          size: '85KB',
          uploadTime: '2024-01-08'
        }
      ],
      assignedLawyers: [
        {
          id: 1,
          name: '张律师',
          role: '主办律师',
          avatar: '',
          caseCount: 28
        },
        {
          id: 2,
          name: '李律师',
          role: '协办律师',
          avatar: '',
          caseCount: 15
        },
        {
          id: 3,
          name: '王律师',
          role: '实习律师',
          avatar: '',
          caseCount: 8
        }
      ],
      recentCases: [
        {
          id: 1,
          title: '沪A12345交通事故赔偿案',
          client: '张某某',
          status: '进行中',
          createTime: '2024-01-18'
        },
        {
          id: 2,
          title: '沪B67890追尾事故案',
          client: '李某某',
          status: '已完成',
          createTime: '2024-01-15'
        },
        {
          id: 3,
          title: '沪C11111人伤赔偿案',
          client: '王某某',
          status: '调解中',
          createTime: '2024-01-12'
        }
      ]
    })
    
    // 方法
    const goBack = () => {
      router.go(-1)
    }
    
    const editBusiness = () => {
      router.push(`/admin/business/edit/${businessData.id}`)
    }
    
    const toggleStatus = () => {
      const action = businessData.status === 'active' ? '停用' : '启用'
      ElMessageBox.confirm(`确认${action}该业务类型？`, '确认操作', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        businessData.status = businessData.status === 'active' ? 'inactive' : 'active'
        ElMessage.success(`业务${action}成功`)
      })
    }
    
    const addPricing = () => {
      ElMessage.info('添加收费标准功能开发中...')
    }
    
    const editPricing = (pricing) => {
      ElMessage.info('编辑收费标准功能开发中...')
    }
    
    const deletePricing = (pricing) => {
      ElMessageBox.confirm('确认删除该收费标准？', '确认删除', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'error'
      }).then(() => {
        const index = businessData.pricingRules.findIndex(p => p.id === pricing.id)
        if (index !== -1) {
          businessData.pricingRules.splice(index, 1)
        }
        ElMessage.success('删除成功')
      })
    }
    
    const editWorkflow = () => {
      router.push(`/admin/workflow-editor/${businessData.id}`)
    }
    
    const uploadDocument = () => {
      ElMessage.info('上传文档功能开发中...')
    }
    
    const getDocumentIcon = (type) => {
      const iconMap = {
        pdf: 'fas fa-file-pdf text-red-500',
        word: 'fas fa-file-word text-blue-500',
        excel: 'fas fa-file-excel text-green-500',
        image: 'fas fa-file-image text-purple-500'
      }
      return iconMap[type] || 'fas fa-file text-gray-500'
    }
    
    const downloadDocument = (doc) => {
      ElMessage.success(`下载文档：${doc.name}`)
    }
    
    const deleteDocument = (doc) => {
      ElMessageBox.confirm(`确认删除文档 ${doc.name}？`, '确认删除', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'error'
      }).then(() => {
        const index = businessData.documents.findIndex(d => d.id === doc.id)
        if (index !== -1) {
          businessData.documents.splice(index, 1)
        }
        ElMessage.success('删除成功')
      })
    }
    
    const assignLawyer = () => {
      ElMessage.info('分配律师功能开发中...')
    }
    
    const viewAllCases = () => {
      router.push('/admin/cases')
    }
    
    const getCaseStatusType = (status) => {
      const typeMap = {
        '进行中': 'primary',
        '已完成': 'success',
        '调解中': 'warning',
        '已暂停': 'info'
      }
      return typeMap[status] || ''
    }
    
    // 角色显示名称映射
    const getRoleDisplayName = (role) => {
      const roleMap = {
        'client': '当事人',
        'primary_lawyer': '主办律师',
        'assistant_lawyer': '协办律师',
        'paralegal': '律师助理',
        'department_manager': '部门主管',
        'finance_staff': '财务人员',
        'marketing_staff': '市场人员',
        'admin_staff': '行政人员',
        'legal_advisor': '法务顾问',
        'external_expert': '外部专家'
      }
      return roleMap[role] || role
    }
    
    // 通知方式显示名称映射
    const getMethodDisplayName = (method) => {
      const methodMap = {
        'system_message': '系统消息',
        'sms': '短信通知',
        'email': '邮件通知',
        'wechat': '微信通知',
        'phone_call': '电话通知'
      }
      return methodMap[method] || method
    }
    
    // 通知时机显示名称映射
    const getTimingDisplayName = (timing) => {
      const timingMap = {
        'step_start': '步骤开始',
        'step_progress': '步骤进行中',
        'step_complete': '步骤完成',
        'step_delayed': '步骤延期',
        'confirmation_needed': '需要确认',
        'issue_occurred': '遇到问题'
      }
      return timingMap[timing] || timing
    }
    
    onMounted(() => {
      // 初始化页面数据
    })
    
    return {
      businessData,
      goBack,
      editBusiness,
      toggleStatus,
      addPricing,
      editPricing,
      deletePricing,
      editWorkflow,
      uploadDocument,
      getDocumentIcon,
      downloadDocument,
      deleteDocument,
      assignLawyer,
      viewAllCases,
      getCaseStatusType,
      getRoleDisplayName,
      getMethodDisplayName,
      getTimingDisplayName
    }
  }
}
</script>

<style scoped>
/* 现代化UI样式 - 与系统风格保持一致 */
.business-detail {
  background: #f8fafc;
  min-height: 100vh;
  padding: 24px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

/* 页面头部 */
.page-header {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid #e5e7eb;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.header-left {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.back-btn {
  margin-top: 4px;
}

.page-title {
  font-size: 24px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
}

.page-description {
  color: #6b7280;
  margin: 0;
  font-size: 14px;
}

.header-actions {
  display: flex;
  gap: 12px;
}

/* 概览卡片 */
.overview-section {
  margin-bottom: 24px;
}

.overview-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.overview-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  gap: 16px;
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.card-content {
  flex: 1;
}

.card-title {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 4px;
}

.card-value {
  font-size: 24px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 4px;
}

.card-subtitle {
  font-size: 12px;
  color: #9ca3af;
}

/* 内容区域 */
.content-section {
  margin-top: 24px;
}

.content-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid #e5e7eb;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin: 0;
  display: flex;
  align-items: center;
}

.card-content {
  padding: 0;
}

/* 信息网格 */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-label {
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
}

.info-value {
  font-size: 16px;
  color: #1f2937;
}

.description-section {
  border-top: 1px solid #e5e7eb;
  padding-top: 20px;
}

.description-content {
  line-height: 1.6;
  color: #374151;
}

/* 工作流程 */
.workflow-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.workflow-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  background: #f9fafb;
  border-radius: 8px;
  border-left: 4px solid #3b82f6;
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #3b82f6;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-title {
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 4px;
}

.step-description {
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 4px;
}

.step-duration {
  font-size: 12px;
  color: #9ca3af;
}

/* 通知配置显示 */
.step-notifications {
  margin-top: 16px;
  padding: 12px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 6px;
}

.notification-header {
  font-size: 14px;
  font-weight: 600;
  color: #0c4a6e;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
}

.notification-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notification-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
}

.notification-label {
  color: #374151;
  font-weight: 500;
  min-width: 70px;
  flex-shrink: 0;
}

.notification-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
}

.role-tag, .method-tag, .timing-tag {
  font-size: 11px;
  padding: 2px 6px;
}

.notification-template {
  color: #6b7280;
  font-style: italic;
  padding: 4px 8px;
  background: white;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
  font-size: 12px;
  flex: 1;
}

.notification-settings-summary {
  margin-top: 8px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.setting-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #6b7280;
}

/* 文档列表 */
.document-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.document-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  transition: background-color 0.2s;
}

.document-item:hover {
  background: #f3f4f6;
}

.document-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.document-info {
  flex: 1;
}

.document-name {
  font-weight: 500;
  color: #1f2937;
  font-size: 14px;
  margin-bottom: 2px;
}

.document-meta {
  font-size: 12px;
  color: #6b7280;
}

.document-actions {
  display: flex;
  gap: 4px;
}

/* 律师列表 */
.lawyer-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lawyer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
}

.lawyer-avatar {
  flex-shrink: 0;
}

.lawyer-info {
  flex: 1;
}

.lawyer-name {
  font-weight: 500;
  color: #1f2937;
  margin-bottom: 2px;
}

.lawyer-role {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 2px;
}

.lawyer-cases {
  font-size: 12px;
  color: #9ca3af;
}

/* 案件列表 */
.case-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.case-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
}

.case-info {
  flex: 1;
}

.case-title {
  font-weight: 500;
  color: #1f2937;
  font-size: 14px;
  margin-bottom: 4px;
}

.case-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: #6b7280;
}

.case-status {
  flex-shrink: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .business-detail {
    padding: 16px;
  }
  
  .header-content {
    flex-direction: column;
    gap: 16px;
  }
  
  .header-left {
    flex-direction: column;
    align-items: stretch;
  }
  
  .overview-cards {
    grid-template-columns: 1fr;
  }
  
  .info-grid {
    grid-template-columns: 1fr;
  }
  
  .content-card {
    padding: 16px;
  }
}
</style>
